package descriptor;

import java.io.Serializable;
import java.util.List;
import java.util.Vector;

public class CompaniesListDescriptor implements Serializable{
	
private List<CompanyDescriptor> companies;
	
	
	
	public CompaniesListDescriptor(){
		companies = new Vector<CompanyDescriptor>();
	}
	
	public void addCompanyDescriptor(CompanyDescriptor company){
		companies.add(company);
	}
	
	public List<CompanyDescriptor> getCompanyDescriptors(){
		return companies;
	}
	
	public int sizeCompaniesList()
	{
		return companies.size();
	}
	
	public CompanyDescriptor getCompany(int id){
		CompanyDescriptor desc = null;
		for(CompanyDescriptor descriptor: companies){
			if(descriptor.getId() == id){
				desc = descriptor;
			}
		}
		return desc;
	}
}
